import 'package:kkhousekeep/generated/json/base/json_field.dart';
import 'package:kkhousekeep/generated/json/notice_detail_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class NoticeDetailEntity {
	late int code;
	late NoticeDetailObj obj;
	late String msg;

	NoticeDetailEntity();

	factory NoticeDetailEntity.fromJson(Map<String, dynamic> json) => $NoticeDetailEntityFromJson(json);

	Map<String, dynamic> toJson() => $NoticeDetailEntityToJson(this);

	NoticeDetailEntity copyWith({int? code, NoticeDetailObj? obj, String? msg}) {
		return NoticeDetailEntity()
			..code= code ?? this.code
			..obj= obj ?? this.obj
			..msg= msg ?? this.msg;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class NoticeDetailObj {
	late int id;
	late String title;
	late String publisher;
	late String context;
	late int views;
	late String publishTime;
	late String createTime;
	late String updateTime;
	late int cid;
	late int read;

	NoticeDetailObj();

	factory NoticeDetailObj.fromJson(Map<String, dynamic> json) => $NoticeDetailObjFromJson(json);

	Map<String, dynamic> toJson() => $NoticeDetailObjToJson(this);

	NoticeDetailObj copyWith({int? id, String? title, String? publisher, String? context, int? views, String? publishTime, String? createTime, String? updateTime, int? cid, int? read}) {
		return NoticeDetailObj()
			..id= id ?? this.id
			..title= title ?? this.title
			..publisher= publisher ?? this.publisher
			..context= context ?? this.context
			..views= views ?? this.views
			..publishTime= publishTime ?? this.publishTime
			..createTime= createTime ?? this.createTime
			..updateTime= updateTime ?? this.updateTime
			..cid= cid ?? this.cid
			..read= read ?? this.read;
	}

	@override
	String toString() {
		return jsonEncode(this);
	}
}